﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:controls="clr-namespace:System.Controls">

  <ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="Common.xaml"/>
  </ResourceDictionary.MergedDictionaries>

  <ControlTemplate x:Key="controlTemplate" TargetType="controls:RepeatButton">
    <Border 
      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
      CornerRadius="{TemplateBinding CornerRadius}"
      BorderThickness="{TemplateBinding BorderThickness}"
      BorderBrush="{TemplateBinding BorderBrush}" 
      Background="{TemplateBinding Background}" >
      <ContentPresenter 
        RecognizesAccessKey="True"
        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
        Margin="{TemplateBinding Padding}"  
        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" 
        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    </Border>

  </ControlTemplate>


  <Style TargetType="{x:Type controls:RepeatButton}" BasedOn="{StaticResource {x:Type Control}}">


    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="HorizontalContentAlignment" Value="Center"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="CornerRadius" Value="2"/>
    <Setter Property="MinHeight" Value="5"/>
    <Setter Property="MinWidth" Value="5"/>

    <Setter Property="Foreground" Value="{StaticResource ButtonForeground}"/>
    <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
    <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
    <Setter Property="Template" Value="{StaticResource controlTemplate}"/>

    <Style.Triggers>
      <Trigger Property="IsMouseOver" Value="True">
        <Setter Property="BorderBrush" Value="White"/>
        <Setter Property="Effect">
          <Setter.Value>
            <DropShadowEffect Color="White" ShadowDepth="0" BlurRadius="4"/>
          </Setter.Value>
        </Setter>
        <Setter Property="Background" Value="{StaticResource ButtonMouseOverBackground}"/>
      </Trigger>

      <Trigger Property="IsPressed" Value="True">
        <Setter Property="Effect" Value="{x:Null}"/>
        <Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
        <Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
      </Trigger>

    </Style.Triggers>
  </Style>


</ResourceDictionary>